﻿using Dapper;
using System.Collections.Generic;
using Think9.Models;

namespace Think9.Repository
{
    public class OrganizeRepository : BaseRepository<OrganizeEntity>
    {
        public IEnumerable<OrganizeEntity> GetOrganizeList()
        {
            using (var conn = dbContext.GetConnection())
            {
                //string sql = @"SELECT a.Id,a.ParentId,a.EnCode,a.FullName,a.SortCode,b.ItemName as CategoryName,a.CreateTime FROM sys_Organize a
                //               INNER JOIN sys_ItemsDetail b ON a.CategoryId=b.Id ORDER BY SortCode ASC";
                string sql = @"SELECT * FROM sys_Organize ORDER BY OrderNo ";
                return conn.Query<OrganizeEntity>(sql);
            }
        }
    }
}